package com.ruoyi.system.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.system.domain.JacTestforsystem;
import com.ruoyi.system.service.IJacTestforsystemService;

/**
 * 测试权限管理的供应商及工厂数据筛选 提供者
 *
 * @author ygx
 * @date 2020-06-17
 */
@RestController
@RequestMapping("jacTestforsystem")
public class JacTestforsystemController extends BaseController
{

	@Autowired
	private IJacTestforsystemService jacTestforsystemService;

	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{testId}")
	public JacTestforsystem get(@PathVariable("testId") Long testId)
	{
		return jacTestforsystemService.selectJacTestforsystemById(testId);

	}

	/**
	 * 查询测试权限管理的供应商及工厂数据筛选列表
	 */
	@GetMapping("list")
	public R list(JacTestforsystem jacTestforsystem)
	{
		startPage();
        return result(jacTestforsystemService.selectJacTestforsystemList(jacTestforsystem));
	}

	/**
	 * 测试
	 */

	@GetMapping("test11")
    public boolean test() {
		return true;
	}

	/**
	 * 新增保存测试权限管理的供应商及工厂数据筛选
	 */
	@PostMapping("save")
	public R addSave(@RequestBody JacTestforsystem jacTestforsystem)
	{
		return toAjax(jacTestforsystemService.insertJacTestforsystem(jacTestforsystem));
	}

	/**
	 * 修改保存测试权限管理的供应商及工厂数据筛选
	 */
	@PostMapping("update")
	public R editSave(@RequestBody JacTestforsystem jacTestforsystem)
	{
		return toAjax(jacTestforsystemService.updateJacTestforsystem(jacTestforsystem));
	}

	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{
		return toAjax(jacTestforsystemService.deleteJacTestforsystemByIds(ids));
	}

}
